function [s_hat,signal] = diff_alamouti_detector_bpsk(h,r,rho,nt,nr,r_previous)

if(length(r_previous)<1)
[s_hat,signal]=alamouti_detector_bpsk(h,r,rho,nt,nr);	

else
r=r*sqrt(nt/rho);
r_previous=r_previous*sqrt(nt/rho);

z=transpose(r)*transpose(r_previous)';
signal(1)=bpsk2bin(z(1,1) + conj(z(2,2)));
signal(2)=bpsk2bin(z(1,2) - conj(z(2,1)));
s_hat(1)=bin2bpsk(signal(1));
s_hat(2)=bin2bpsk(signal(2));

end
